// ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables
import 'package:flutter/material.dart';

// import 'package:junyeyishu/widgets/QGWebViewWidget.dart';
import 'package:junyeyishu/widgets/QGWidget.dart';
 import 'package:flutter_html/flutter_html.dart';
import 'package:junyeyishu/utils/utils.dart';

class QGBulletinDetailPage extends StatefulWidget {
  dynamic args;
  QGBulletinDetailPage({super.key, required this.args});
  @override
  State<QGBulletinDetailPage> createState() => _QGBulletinDetailPageState();
}

class _QGBulletinDetailPageState extends State<QGBulletinDetailPage> {
 

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    dynamic data = widget.args["data"];

    return QGScaffold(
     bgColor: Color(0XFF0c1012),
      title: widget.args["title"] ?? "",
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              padding: EdgeInsets.all(20.rpx),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    "君樾艺术重磅推出，更多惊喜等你来！",
                    style: TextStyle(
                        color: Color(0xFFffffff),
                        fontSize: 18.rpx,
                        fontWeight: FontWeight.bold),
                  ),
                  SizedBox(height: 12.rpx),
                  Row(
                    children: [
                      Container(
                        padding: EdgeInsets.symmetric(horizontal: 10,vertical: 2),
                        decoration: BoxDecoration(
                          color: Color(0XFF44FFE2),
                          borderRadius: BorderRadius.circular(25),
                        ),
                        child: Text(data?["name"] ?? "",style: TextStyle(fontSize: 12,color: Color(0XFF111111))),
                      ),
                      SizedBox(width:5,),
                      Text(
                          data?["created"] ?? "",
                          style: TextStyle(
                              color: Color(0xFFffffff),
                              fontSize: 11.rpx,
                              fontWeight: FontWeight.normal),
                        )
                    ],
                  )
                  ,
                  SizedBox(height: 20.rpx),
                  Container(height: 0.5.rpx, color: Color(0xFFEAEAEA)),
                  SizedBox(height: 30.rpx),
                  // QGImage(asset: "bulletin_top.jpg", width: kScreenWidth),

                  Html(data: data?["content"] ?? "",
                  style: {
                      "p": Style(
                        color: Color(0XFFFFFFFF),
                        margin: Margins.only(top: 0,bottom: 0),
                        padding: HtmlPaddings.only(top: 0,bottom: 0),
                        lineHeight: LineHeight(1.0), // 调整行高
                      ),
                      "br": Style(
                        margin: Margins.only(top: 0,bottom: 0),
                        padding: HtmlPaddings.only(top: 0,bottom: 0),
                        height: Height(1), // 调整换行高度
                      ),
                    },),

                  // QGWebViewWidget( 
                  //   str: data?["content"] ?? "",
                  //   textColor: "#ffffff",
                  //   bgColor: "#0c1012",
                  // ),
                  SizedBox(height: 30.rpx),
                  // QGImage(asset: "bulletin_bottom.jpg"),
                  SizedBox(height: 20.rpx),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
